import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import VueRouter from 'vue-router'
import router from './router'
import App from './App.vue'
import store from './store/store'
import axios from 'axios'

Vue.use(ElementUI)
Vue.use(VueRouter)

// axios
axios.defaults.baseURL = 'http://activity.cloudlinker.cn'

router.beforeEach((to, from, next) => {
    store.commit('hideAllBtn')
    switch (to.name) {
        case 'home':
            break
        case 'lottery':
            store.commit('storageLotteryBtn', true)
            break
        case 'turntable':
            store.commit('storageTurntableResultBtn', true)
            break
        default:
            break
    }
    next()
})

Vue.prototype.$http = axios

new Vue({
    el: '#app',
    router,
    store,
    render: h => h(App)
})
